package com.j2eefast.web.job.task;

import com.j2eefast.web.service.SpuService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component("jobInitSpu")
public class JobInitSpu {

    private Logger LOGGER = LoggerFactory.getLogger(JobInitSpu.class);

    @Autowired
    private SpuService spuService;

    public void initSpu(){
        LOGGER.info("开始初始化商品信息");
        Long startTime = System.currentTimeMillis();
        spuService.initSpus();
        LOGGER.info("完成分类初始化，共计耗时{}秒" , (System.currentTimeMillis() - startTime) / 1000);
    }
}
